//
//  VDead.m
//  Void Dead
//
//  Created by Sidney Just on 03.07.09.
//  Copyright 2009 by Sidney Just
//  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; 
//  either version 3 of the License, or (at your option) any later version.
//  
//  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty 
//  of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//  

//OpenGL
#import <QuartzCore/QuartzCore.h>
#import <OpenGLES/EAGLDrawable.h>
#import <OpenGLES/EAGL.h>
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>

//Includes
#import "vector.h"
#import "color.h"
#import "panel.h"
#import "panelManager.h"
#import "Animation.h"
#import "Image.h"
#import "label.h"
#import "labelManager.h"
#import "ParticleEmitter.h"
#import "Contentmanager.h"

#import "CollisionManager.h"

//Classes
@class VD_Vector;
@class VD_Color;
@class VD_Animation;
@class VD_Image;
@class VD_label;
@class VD_ParticleEmitter;
@class VD_ContentManager;

//Function prototypes
/**
 * Creates a temporary vector with the given values
 @param x The value for the x-axis
 @param y The value for the y-axis
 @param z The value for the z-axis
 **/
VD_Vector* vector(GLfloat x, GLfloat y, GLfloat z);

/**
 * Creates a temporary color with the given values
 @param red The value for the red channel
 @param green The value for the green channel
 @param blue The value for the blue channel
 **/
VD_Color*  color(GLfloat red, GLfloat green, GLfloat blue);
void       ptr_remove(id ptr);
void       initHandleManager();
void       removeHandleManager();
id         ptr_for_handle(int handle);
int        ptr_to_handle(id ptr);

/**
 * Adds the first vector to the second vector
 * Algorithm: Vector1 += Vector2;
 @param vector1 The first vector
 @param vector2 The second vector
 **/
void       vec_add(VD_Vector *vector1, VD_Vector *vector2);

/**
 * Fills all axis of an given vector with the given value
 * Algorithm: Vector = fill;
 @param vec The vector
 @param fill The value
 **/
void       vec_fill(VD_Vector *vec, float fill);

/**
 * Sets the first vector to the second vector
 * Algorithm: Vector1 = Vector2;
 @param vector1 The first vector
 @param vector2 The second vector
 **/
void       vec_set(VD_Vector *vector1, VD_Vector *vector2);

/**
 * Subtracts the first vector from the second vector
 * Algorithm: Vector1 -= Vector2;
 @param vector1 The first vector
 @param vector2 The second vector
 **/
void       vec_sub(VD_Vector *vector1, VD_Vector *vector2);

/**
 * Calculates the distance between the first and the second vector
 @param vector1 The first vector
 @param vector2 The second vector
 @return Distance between both vectors
 **/
float      vec_dist(VD_Vector *vector1, VD_Vector *vector2);

/**
 * Inverts the given vector
 @param vec The vector to invert
 **/
void       vec_inverse(VD_Vector *vec);

/**
 * Calculates the length of a given vector
 @param vec The vector
 @return Length of the vector
 **/
float      vec_length(VD_Vector *vec);

/**
 * Scales a vector along a given factor
 @param vec The vector which should be scales
 @param factor The factor of the scale
 **/
void       vec_scale(VD_Vector *vec, float factor);

void	   col_set(VD_Color *col1, VD_Color *col2);

void	   vec_to_col(VD_Color *col, VD_Vector *vec);
void	   col_to_vec(VD_Vector *vec, VD_Color *col);

//Engine
#import "Engine.h"
@class VD_Engine;